<style>
  #body {
    padding: 0 1px 0 0;
  }
</style>

<table class="marginbottom10">
  <tbody>
  <tr class="property">
    <td style="padding: 10px">
      <p class="spacer-bottom">Secret key is registered. You can encrypt any property value with the following form:</p>

        <form 	class="spacer-bottom"
               onsubmit=
                 "$j.ajax({
                   url:'<%=ApplicationController.root_context-%>/encryption_configuration/encrypt',
                   type:'post',
                   success:function(response)
                     {
                       $j('#encrypted_section').html(response);
                       $j('#encrypted_section').show();
                       $j('#encryption_error').hide();
                       },
                   error:function(response)
                     {
                       $j('#encryption_error').html(response.responseText);
                       $j('#encryption_error').show();
                       $j('#encrypted_section').hide();
                       },
                   data:$j(this).serialize()
                   });
                   return false;"
               method="post"
               action="<%=ApplicationController.root_context-%>/encryption_configuration/encrypt"	>
        <input type="text" name="text" id="clear_text"/>
        <input type="submit" value="Encrypt" id="submit_encrypt"/>
      </form>

      <div id="encrypted_section" style="display:none"></div>
      <span id="encryption_error" class="error" style="display:none"></span>

      <p><br/>Note that the <%= link_to 'secret key can be changed', {:action => 'generate_secret_form'}, :class => 'link-action', :id => 'link-generate-key' %>
        but all the encrypted properties will have to be updated. <a href="http://docs.codehaus.org/display/SONAR/Settings+Encryption" class="external" target="sonar_doc">More information</a>.</p>
    </td>
  </tr>
  </tbody>
</table>

<script>
  $j('#clear_text').focus();
</script>
